feat: Full/Selective/OnDemand skill deployment modes#5
Merged
Conversation
Adds three deployment modes for controlling how skills are loaded into agent context: - Full (default): All assigned skills loaded at startup. Best for agents with ≤5 skills. - Selective: Only specific capabilities from each skill, filtered by keyword matching against prompt_context markdown sections. - OnDemand: Nothing injected at startup. Skills resolved per-task by matching user message against skill trigger descriptions (name, tags, tools, description). Changes: - openfang-types/agent.rs: Add SkillDeploymentMode enum, SkillCapabilityFilter struct, skill_deployment field on AgentManifest - openfang-skills/deployment.rs: New module with SkillDeployer resolver (summary builder, context collector, on-demand keyword matcher) - openfang-skills/lib.rs: Register deployment module - openfang-kernel/kernel.rs: Wire build_skill_summary() and collect_prompt_context() to delegate to SkillDeployer based on deployment mode Backward compatible — SkillDeploymentMode defaults to Full, preserving existing behavior for all agents that don't specify a deployment mode.
Fixes CI: f32 doesn't implement Eq. SkillDeploymentMode now derives PartialEq only. Wires resolve_on_demand() into both run_agent_loop() and run_daemon_agent_loop(): - Pattern-matches manifest.skill_deployment for OnDemand variant - Takes SkillRegistry snapshot, filters by agent skill allowlist - Calls SkillDeployer::resolve_on_demand() with user message - Injects matched skill prompt_context into system_prompt for this turn - External skills wrapped in trust boundary - Logs matched skills at info level
Adds SkillDeploymentMode::default() to every explicit AgentManifest struct literal that doesn't use ..Default::default() spread: - kernel.rs: 2 test helpers - wizard.rs: agent creation wizard - registry.rs: test helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements three skill deployment modes from the Expert Skill Forge design doc (Section 9.3).
Deployment Modes
Files Changed
crates/openfang-types/src/agent.rs- SkillDeploymentMode enum, SkillCapabilityFilter, skill_deployment fieldcrates/openfang-skills/src/deployment.rs- New: SkillDeployer resolvercrates/openfang-skills/src/lib.rs- Register deployment modulecrates/openfang-kernel/src/kernel.rs- Wire build_skill_summary and collect_prompt_context to SkillDeployerBackward Compatible
Defaults to Full mode. Existing agents work unchanged.
Tests
22 total: 14 in deployment.rs (keyword matching, section filtering, caps), 8 in agent.rs (serde, TOML, defaults).